<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.staticfile.org/angular.js/1.4.6/angular.min.js"></script>
    <script>
        var app = angular.module("domeController",[]);
        app.controller("myController",function ($scope) {
            //写方法
            $scope.add=function () {
                $scope.z=parseInt($scope.x)+parseInt($scope.y);
            }
        });
    </script>
</head>
<body>
<h3>angularjs的点击事件:调用controllerjs相加xy</h3>
    <div ng-app="domeController" ng-controller="myController" >
        x:<input ng-model="x" /><br>
        y:<input ng-model="y" /><br>
        <button ng-click="add()">运算</button>:{{z}}
    </div>
</body>
</html>